# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=nipper
pkgver=0.11.7
pkgrel=4
groups=('blackarch' 'blackarch-networking' 'blackarch-recon')
pkgdesc='Network Infrastructure Parser.'
arch=('x86_64' 'aarch64')
url='https://www.titania-security.com/'
license=('GPL3')
source=("https://dl.packetstormsecurity.net/cisco/$pkgname-$pkgver.tgz")
sha512sums=('da35438462dafb654c51da7dbc0ca68410375d70239b527f3ee5fce9fa64a7f07e3ed5dde2640fa448b2b8075af0640b77e64280de2818c92223ad19b717f6dd')

build(){
  cd "$pkgname-$pkgver"

  make
}

package() {
  cd "$pkgname-$pkgver"

  install -dm 755 "$pkgdir/usr/bin/"
  install -dm 755 "$pkgdir/etc/"
  install -dm 755 "$pkgdir/usr/share/licenses/$pkgname"
  install -dm 755 "$pkgdir/usr/share/$pkgname"
  install -dm 755 "$pkgdir/usr/share/man/man1"
  install -dm 755 "$pkgdir/usr/share/man/man5"

  install -m 644 LICENSE "$pkgdir/usr/share/licenses/$pkgname"
  install -m 644 man/nipper.1 "$pkgdir/usr/share/man/man1"
  install -m 644 man/nipper.conf.5 "$pkgdir/usr/share/man/man5"

  cp -a --no-preserve=ownership CSS Changelog FW1 IOS NMP PIX Passport \
    Readme ScreenOS SonicOS Template cisco common docs \
    "$pkgdir/usr/share/$pkgname/"

  install -Dm 755 $pkgname "$pkgdir/usr/bin/$pkgname"
  install -m 644 "$pkgname.conf" "$pkgdir/etc/"
}

